<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
<div id="app">
    <h1>Hello</h1>
    <button @click="ces">测试</button>
    <p>{{a}}</p>
    <button @click="ces2">测试</button>
</div>



<script src="./axios.min.js"></script>

<script type="module">
    import { createApp, ref } from "./vue.esm.js";
    const app = createApp({
        setup() {
            const a = ref('nihao')
            const ces = () => {
                a.value = 'buzhidao'
            }
            const ces2 = async () => {
                try {
                    const {data} = await axios.get('http://localhost:8080/myjavaweb_de_war_exploded/ce1');
                    console.log(data)
                    console.log(data.id)
                    console.log(data.cs)
                } catch (error) {
                    console.error('获取文本失败:', error);
                }
            }

            return {
                ces, ces2, a
            }
        }
    })
    app.mount("#app");
</script>
</body>

</html>